package com.sc.nft.dao;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sc.nft.mapper.SaasExcludeMapper;
import com.sc.nft.entity.SaasExclude;
import com.sc.nft.service.SaasExcludeService;
import org.springframework.stereotype.Service;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

/**
 * saas任务在处理的时候需要排除的商品or藏品,反比操作判定(SaasExclude)表Dao层
 *
 * @author 王伟成
 * @since 2024-06-15 15:34:31
 */
@Slf4j
@Repository
public class SaasExcludeDao extends ServiceImpl<SaasExcludeMapper, SaasExclude> {

    public Boolean existTaskIdAndProductId(Long taskId, Long productId) {
        return lambdaQuery().eq(SaasExclude::getSaasTaskId, taskId).eq(SaasExclude::getConditionId, productId).count() > 0;
    }
}
